<?php

class ICore_Db_Row extends Zend_Db_Table_Row
{


    /**
     * Constructor.
     *
     * Supported params for $config are:-
     * - table       = class name or object of type Zend_Db_Table_Abstract
     * - data        = values of columns in this row.
     *
     * @param  array $config OPTIONAL Array of user-specified config options.
     * @return void
     * @throws Zend_Db_Table_Row_Exception
     */
//    public function __construct(array $config = array())
//    {
//        if (isset($config['table']) && $config['table'] instanceof Apk_Db_Table) {
//            $this->_table = $config['table'];
//            $this->_tableClass = get_class($this->_table);
//        }
//
//        if (isset($config['data'])) {
//            if (!is_array($config['data'])) {
//                require_once 'Zend/Db/Table/Row/Exception.php';
//                throw new Zend_Db_Table_Row_Exception('Data must be an array');
//            }
//            $decorator = $this->_table->getDecorator();
//            if (!is_null($decorator)){
//                $result = array();
//                foreach ($config['data'] as $key=>$value) {
//                    $decorated_row = $this->_table->$decorator($key, $value);
//                    list($k, $v) = each($decorated_row);
//                    $result[$k] = $v;
//                }
//                $config['data'] = $result;
//            }
//            $this->_data = $config['data'];
//        }
//        if (isset($config['stored']) && $config['stored'] === true) {
//            $this->_cleanData = $this->_data;
//        }
//
//        // Retrieve primary keys from table schema
//        if ($table = $this->_getTable()) {
//            $info = $table->info();
//            $this->_primary = (array) $info['primary'];
//        }
//    }
    /**
     * Set row field value
     *
     * @param  string $columnName The column key.
     * @param  mixed  $value      The value for the property.
     * @return void
     * @throws Zend_Db_Table_Row_Exception
     */
//    public function __set($columnName, $value)
//    {
//        $columnName = $this->_transformColumn($columnName);
//        if (!array_key_exists($columnName, $this->_data)) {
//            require_once 'Zend/Db/Table/Row/Exception.php';
//            throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
//        }
//        $decorator = $this->_table->getDecorator();
//        if (!is_null($decorator)){
//            $result = $this->_table->$decorator($columnName, $value);
//            list($columnName, $value) = each($result);
//        }
//    }

}